import type { VbenFormSchema } from '#/adapter/form';
import { z } from '#/adapter/form';

// 编辑弹窗表单配置
export const formSchema: VbenFormSchema[] = [
  {
    component: 'ImageUpload',
    fieldName: 'companyLogo',
    description: '图片建议尺寸长*宽为520*350',
    label: '机构简介图片',
    rules: z.string().min(1, { message: '图片建议尺寸长*宽为520*350' }),
  },
  {
    component: 'Textarea',
    componentProps: {
      placeholder: '请输入机构简介',
      allowClear: true,
      autosize: {
        minRows: 4,
      },
    },
    fieldName: 'companyDesc',
    label: '机构简介',
    rules: 'required',
  },
  {
    component: 'TinymceEditor',
    fieldName: 'businessScope',
    label: '机构介绍',
    rules: 'required',
  },
  {
    component: 'Input',
    componentProps: {
      placeholder: '请输入邮箱',
      allowClear: true,
    },
    fieldName: 'companyEmail',
    label: '邮箱',
    rules: 'required',
  },
  {
    component: 'Input',
    componentProps: {
      placeholder: '请输入服务电话',
      allowClear: true,
    },
    fieldName: 'linkTel',
    label: '服务电话',
    rules: 'required',
  },
  {
    component: 'Input',
    componentProps: {
      placeholder: '请输入投诉电话',
      allowClear: true,
    },
    fieldName: 'complaintTel',
    label: '投诉电话',
    rules: 'required',
  },
  {
    component: 'Input',
    componentProps: {
      placeholder: '请输入机构地址',
      allowClear: true,
    },
    fieldName: 'companyAddress',
    label: '机构地址',
    rules: 'required',
  },
];
